package com.wy2.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import com.wy2.entity.Clock;
import com.wy2.util.FenyeUtil;

public interface ClockMapper {


	/**
	 * 修改签到状态
	 * @param u
	 * @return
	 */
	Integer upClock(Clock u);
/**
 * 添加签到状态
 * @param u
 * @return
 */
	Integer addClock(Clock u);
	
	@Select("select * from `user` u inner join clock c on u.uid = c.uid where u.uid = #{uid} and checkintime >= #{checkintime}")
	Clock getUsers(String uid, String checkintime);
	/**
	 * 获取条数
	 * @param fenye
	 * @return
	 */
	Integer getCount(FenyeUtil<Clock> fenye);
	/**
	 * 分页查询数据
	 * @param fenye
	 * @return
	 */
	List<Clock> getAllUchecks(FenyeUtil<Clock> fenye);
/**
 * 通过签到用户id查询数据
 * @param u
 * @return
 */
	@Select("select * from clock where uid = #{ext} order by checkintime desc")
	List<Clock> getTimelast(Clock u);
/**
 * 通过签到id查询
 * @param id
 * @return
 */
	@Select("select * from clock where cid = #{id}")
	List<Clock> findById(String id);
/**
 * 查询全部
 * @return
 */
	@Select("select * from clock")
	List<Clock> findAll();
/**
 * 添加签到信息
 * @param s
 * @return
 */
	@Insert("insert into clock(uid,uname,cstatus,checkintime,checkoutime,ext,ext1)values(#{uid},#{uname},#{cstatus},#{checkintime},#{checkoutime},#{ext},#{ext1})")
	Integer importSingin(Clock s);

	Integer updateClock();


	

}
